var httpsUrl = getApp().globalData.httpsUrl;
var globalData = getApp().globalData;
var commonUtil = require("../../../utils/commonUtil.js")
Page({
  data: {
    imgUrl: globalData.imgUrl,
    list: [],
  },
  list: function () {
    var params = new Object();
    var that = this;
    let openId = wx.getStorageSync("openidKey");
    console.log("param:" + JSON.stringify(params));
    wx.request({
      header: { "openId": openId, "content-Type": "application/x-www-form-urlencoded" },
      url: httpsUrl + "/card/getMyMemberCard",
      dataType: "json",
      method: "GET",
      // data: params,
      success: function (res) {
        res = res.data;
        console.log("res：" + JSON.stringify(res));
        if (res.result == 0) {
          let rows = res.data;
          that.setData({ list: rows })
        }
      }
    })
  },
  memberCardShop: function () {
    wx.navigateTo({
      url: '../../homepage/memberCardShop/memberCardShop',
    })
  },
  memberCardInfo: function (e) {
    let id = e.currentTarget.id;
    wx.setStorageSync("cardId", id)
    wx.navigateTo({
      url: '../../homepage/memberCardInfo/memberCardInfo',
    })
  },
  memberCardUseNote: function () {
    wx.navigateTo({
      url: '../../homepage/memberCardUseNote/memberCardUseNote',
    })
  },
  onLoad: function (options) {
    this.list();
  },
})